package boddaert.philippe.cashGame;

public class GameConfiguration {

	private String url;
	private double price;
	private int numberNew;
	private int numberSecondHand;
	private String site;
	private GameConfigurationCurrencyType type;

	public GameConfiguration(String site, GameConfigurationCurrencyType type) {
		this.site = site;
		this.type = type;
		this.url = null;
		this.price = -1;
		this.numberNew = 0;
		this.numberSecondHand = 0;
	}

	public void setUrl(String url) {
		this.url = url;

	}

	public void setBestPrice(double price) {
		this.price = price;

	}

	public void setNumberNewAvailable(int number) {
		this.numberNew = number;
	}

	public void setNumberSecondHandAvailable(int number) {
		this.numberSecondHand = number;

	}

	public String getUrl() {
		return this.url;
	}

	public double getBestPrice() {
		return this.price;
	}

	public int getNumberNewAvailable() {
		return this.numberNew;
	}

	public int getNumberSecondHandAvailable() {
		return this.numberSecondHand;
	}

	public String getSite() {
		return this.site;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null)
			return false;

		if (!(obj instanceof GameConfiguration))
			return false;

		GameConfiguration configuration = (GameConfiguration) obj;
		if (this.site == null)
			return (configuration.getSite() == null);

		return this.site.equals(configuration.getSite());
	}

	public GameConfigurationCurrencyType getType() {
		return this.type;
	}
}
